public class GCD {
    public static void main(String[] args) {

        int a = 66;
        int b = 128;
        int i = 0;
        int min = 0;
        int paragon = 0;//记录公因数

        min = a > b ? b : a;

        for (i = 1; i <= min; i++) {
            if (a % i == 0 && b % i == 0) {
                paragon = i;
            }
        }

        System.out.println("最大公因数为：" + (paragon));
    }
}
